import request from '@/plugins/request';
import dayjs from 'dayjs';

// 网络月计划任务——绑定渠道
export function netsettingbindchannel(data) {
    return request({
        url: '/v1/net/setting/bind-channel',
        method: 'post',
        data
    });
}

// 网络月计划任务——新增、编辑营销中心
export function netsettingaddedit(data) {
    return request({
        url: '/v1/net/setting/add-edit',
        method: 'post',
        data
    });
}

// 月计划任务——营销中心列表
export function netsettingindex(data) {
    return request({
        url: '/v1/net/setting/index',
        method: 'get',
        params: data
    });
}

// 网络月计划任务——渠道列表
export function netsettingchannellist(data) {
    return request({
        url: '/v1/net/setting/channel-list',
        method: 'get',
        params: data
    });
}

// 网络月计划任务——项目列表
export function netsettingprojectlist(data) {
    return request({
        url: '/v1/net/setting/project-list',
        method: 'get',
        params: data
    });
}

// 网络月计划任务——项目绑定
export function netsettingbindproject(data) {
    return request({
        url: '/v1/net/setting/bind-project',
        method: 'post',
        data
    });
}

// 网络月计划任务——人员列表
export function netsettingmemberlist(data) {
    return request({
        url: '/v1/net/setting/member-list',
        method: 'get',
        params: data
    });
}

// 网络月计划任务——绑定人员
export function netsettingbindmember(data) {
    return request({
        url: '/v1/net/setting/bind-member',
        method: 'post',
        data
    });
}

// 进度表
export function netreportschedule(data) {
    let datas = { ...data };
    if(data.month) {
        datas.month = dayjs(data.month).format('YYYY-MM');
    }
    return request({
        url: '/v1/net/report/schedule',
        method: 'get',
        params: datas
    });
}

// 进度表筛选项
export function netreportschedulecondition(data) {
    return request({
        url: '/v1/net/report/schedule-condition',
        method: 'get',
        params: data
    });
}

// 项目报表
export function netreportproject(data) {
    let datas = { ...data };
    if(data.month) {
        datas.month = dayjs(data.month).format('YYYY-MM');
    }
    return request({
        url: '/v1/net/report/project',
        method: 'get',
        params: datas
    });
}

// 项目筛选项
export function netreportprojectcondition(data) {
    return request({
        url: '/v1/net/report/project-condition',
        method: 'get',
        params: data
    });
}

// 同比
export function netreportcompareproject(data) {
    let datas = { ...data };
    if(data.month) {
        datas.month = dayjs(data.month).format('YYYY-MM');
    }
    return request({
        url: '/v1/net/report/compare-project',
        method: 'get',
        params: datas
    });
}

// 计划列表
export function netplanlist(data) {
    let datas = { ...data };
    if(data.month_time) {
        datas.month_time = dayjs(data.month_time).format('YYYY-MM');
    }
    return request({
        url: '/v1/net/plan/list',
        method: 'get',
        params: datas
    });
}

// 月计划-查看/新增 回显
export function netplanplaninfo(data) {
    return request({
        url: '/v1/net/plan/plan-info',
        method: 'get',
        params: data
    });
}

// 编辑月计划详情 /回显
export function netplaneditinfo(data) {
    return request({
        url: '/v1/net/plan/edit-info',
        method: 'get',
        params: data
    });
}

// 删除月计划
export function netplandelplan(data) {
    return request({
        url: '/v1/net/plan/del-plan',
        method: 'post',
        data
    });
}

// 添加计划
export function netplanaddplan(data) {
    return request({
        url: '/v1/net/plan/add-plan',
        method: 'post',
        data
    });
}
// ip段搜索
export function ipSearch(data) {
    return request({
        url: '/v1/marketing/ip-search/ip-search',
        method: 'get',
        params: data
    });
}
// 匹配词搜索
export function matchingSearch(data) {
    return request({
        url: '/v1/search/search/matching',
        method: 'get',
        params: data
    });
}
// 专业词搜索
export function specialtySearch(data) {
    return request({
        url: '/v1/search/search/specialty',
        method: 'get',
        params: data
    });
}
// 搜索词列表
export function searchList(data) {
    return request({
        url: '/v1/search/search/search-list',
        method: 'get',
        params: data
    });
}
// 新增配置匹配词专业词
export function addMatching(data) {
    return request({
        url: '/v1/search/search/search-add',
        method: 'post',
        data
    });
}
// 更新 匹配词/专业词
export function searchUpdate(data) {
    return request({
        url: '/v1/search/search/search-update',
        method: 'post',
        data
    });
}
// 删除匹配词专业词
export function searchDelete(data) {
    return request({
        url: '/v1/search/search/search-delete',
        method: 'post',
        data
    });
}
// /钉钉提醒
// 钉钉提醒列表
export function settingIndex(data) {
    return request({
        url: '/v1/search/setting/index',
        method: 'get',
        params: data
    });
}
// 钉钉提醒新增、编辑
export function updateInfo(data) {
    return request({
        url: '/v1/search/setting/update-robot-info',
        method: 'post',
        data
    });
}
// 钉钉提醒删除
export function deleteInfo(data) {
    return request({
        url: '/v1/search/setting/delete-robot-info',
        method: 'post',
        data
    });
}
// 导出
export function searchexport(data) {
    return request({
        url: '/v1/search/search/export-report',
        method: 'get',
        responseType: 'blob',
        params: data
    });
}
// 关键词搜索
export function keywordsSearch(data) {
    return request({
        url: '/v1/search/search/keywords-report',
        method: 'get',
        params: data
    });
}
// 关键词导出
export function keywordsExport(data) {
    return request({
        url: '/v1/search/search/export-keywords-report',
        method: 'get',
        responseType: 'blob',
        params: data
    });
}
// 词性配置
export function cixingList(data) {
    return request({
        url: '/v1/search/setting/cixing-list',
        method: 'get',
        params: data
    });
}
// /词性新增、编辑
export function updateCixing(data) {
    return request({
        url: '/v1/search/setting/update-cixing',
        method: 'post',
        data
    });
}
// 词性删除
export function deleteCixing(data) {
    return request({
        url: '/v1/search/setting/delete-cixing',
        method: 'post',
        data
    });
}
// 词性分析导入
export function excelExport(data) {
    return request({
        url: '/v1/search/cixing/export-excel',
        method: 'get',
        responseType: 'blob',
        params: data
    });
}
// 报表
// 获取部门新增或编辑下拉信息病种
export function getDepartmentInfo(data) {
    return request({
        url: '/v1/rbac/department/select-info',
        method: 'get',
        params: data
    });
}
// 通话时段统计
export function voiceStatics(data) {
    return request({
        url: '/v1/analyse/customer-report/voice-statics',
        method: 'get',
        params: data
    });
}
// 客服列表
export function accountList(data) {
    return request({
        url: '/v1/analyse/customer-report/account-list',
        method: 'get',
        params: data
    });
}
// 客户微信统计
export function wechatreportList(data) {
    return request({
        url: '/v1/analyse/customer-report/wechat-report-list',
        method: 'get',
        params: data
    });
}
// 客服通话统计
export function voicereportList(data) {
    return request({
        url: '/v1/analyse/customer-report/voice-report-list',
        method: 'get',
        params: data
    });
}

// 渠道列表
export function marketingconsumegetsourcechannellist(data) {
    return request({
        url: '/v1/marketing/consume/channel-for-clue',
        method: 'get',
        params: data
    });
}

// 线索导入列表
export function clueList(data) {
    return request({
        url: '/v1/clue/data-import/data-import-list',
        method: 'get',
        params: data
    });
}
// 线索导入
export function clueImport(data) {
    return request({
        url: '/v1/clue/data-import/import-excel',
        method: 'post',
        isUpload: true,
        data
    });
}
// 线索删除
export function clueDel(data) {
    return request({
        url: '/v1/clue/data-import/delete-data-and-clue',
        method: 'post',
        data
    });
}
// 财务对账单-充值列表
export function billList(data) {
    return request({
        url: 'v1/marketing/bill-recharge/bill-recharge-list',
        method: 'get',
        params: data
    });
}
// 财务对账单-新增、编辑
export function billCreate(data) {
    return request({
        url: 'v1/marketing/bill-recharge/update-bill-recharge',
        method: 'post',
        data
    });
}
// 财务对账单-删除
export function billDel(data) {
    return request({
        url: 'v1/marketing/bill-recharge/delete-bill-recharge',
        method: 'post',
        data
    });
}
// 财务对账单-同步钉钉
export function synDingtalk(data) {
    return request({
        url: 'v1/marketing/dingtalk/syn-dingtalk-money-record',
        method: 'get',
        params: data
    });
}
// 财务对账单-对账单-列表
export function dingtalkBillList(data) {
    return request({
        url: 'v1/marketing/dingtalk/bill-list',
        method: 'get',
        params: data
    });
}
// 财务对账单-对账单-对账
export function checkBill(data) {
    return request({
        url: 'v1/marketing/dingtalk/check-bill',
        method: 'post',
        data
    });
}
// 财务对账单-对账单-扎账
export function endBill(data) {
    return request({
        url: 'v1/marketing/dingtalk/end-bill',
        method: 'post',
        data
    });
}
// 财务对账单-钉钉同步审批获取同步状态
export function synDingtalkStatus(data) {
    return request({
        url: '/v1/marketing/dingtalk/syn-dingtalk-status',
        method: 'get',
        params: data
    });
}
// 财务对账单-筛选列表
export function billCondition(data) {
    return request({
        url: 'v1/marketing/dingtalk/bill-list-condition',
        method: 'get',
        params: data
    });
}